from selenium.webdriver.common.by import By
from time import sleep
from base import Base
class SouSuopage(Base):
    sousuokuang1='new UiSelector().text("搜索菜谱")'
    sousuokuang2=(By.XPATH,'//android.widget.TextView[@text="搜索菜谱"]')
    shurukuang1=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[2]/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.EditText')
    shurukuang2=(By.ID,'com.xiachufang:id/search_edit_text')
    sousuoanniu1='new UiSelector().text("搜索")'
    sousuoanniu2='new UiSelector()./hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[3]/android.widget.TextView'
    duanyan1=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout/android.widget.LinearLayout/androidx.recyclerview.widget.RecyclerView/android.widget.TextView[1]')
    duanyan2=(By.XPATH,'//android.widget.TextView[@text="综合"])')







    def sousuoyewu(self,neirong):
        self.find_ele(self.sousuokuang1).click()
        sleep(5)
        self.find_ele(self.shurukuang1).send_keys(neirong)
        sleep(5)
        self.find_ele(self.sousuoanniu1).click()
        sleep(5)
